import React, { Component } from 'react';
import { Form, Input } from "antd"


class ResetCategory extends Component {

    UNSAFE_componentWillMount(){
        // console.log(this.props);
        this.props.resetName(this.props.form);
    }

    render() {
        const { getFieldDecorator } = this.props.form;
        const {name} =this.props;
        return (
            <div>
                <Form>
                    <Form.Item>
                        {
                            getFieldDecorator("categoryName",{
                                rules:[
                                    { required: true, message: '分类名称不能为空！' }
                                ],
                                initialValue:name
                            })(
                                <Input placeholder="请输入分类名称"></Input>
                            )
                        }
                    </Form.Item>
                </Form>
            </div>
        );
    }
}
const WrappedNormalLoginForm = Form.create()(ResetCategory)
export default WrappedNormalLoginForm;